/**
 * 
 */
package baduga.server;

import baduga.core.Core_JsonDataSchema;

/**
 * @author Janek
 *
 */
public class F_PlayerEnvSwitch {
	
	
	
	/**
	 * Zajmuje się obsługą procesy tworzenia listy stołów
	 * 
	 * @param data
	 * @return
	 */
	public static Core_JsonDataSchema getTableList(Core_JsonDataSchema data)
	{
		//Def.
		Core_JsonDataSchema reData;
		Object[][] internData;
		
		Serwer serweraHandler;
		
		//Init.
		reData = new Core_JsonDataSchema(0x02, new int[]{
			0x02
		}, null, null);
		
		serweraHandler = Controler.getcSerwer();
		
		
		
		
		
		Object[] tmpData = data.getDataD1();
		
		//Pobranie listy stołów
		internData = serweraHandler.getTableList(new int[] {
				Core_JsonDataSchema.toInt(tmpData[0]), Core_JsonDataSchema.toInt(tmpData[1])	
		});
		
		
		if((boolean) internData[0][0])
		{
			reData.setDataD1(new Object[] {
				true
			});
			
			reData.setDataD2(new Object[][] {
				internData[1]
			});
		}
		else
		{
			reData.setDataD1(new Object[] {
				false, internData[0][1]
			});
			
		}
		
		
		
		
		return reData;
	}

}
